package com.example.pufang.controller;

import com.example.common.CommonResult;
import com.example.common.PageParamRequest;
import com.example.pufang.service.LoginService;
import com.example.pufang.vo.PageListVo;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/login")
@CrossOrigin
@Api(tags = "web登录日志接口")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @Operation(summary = "获取分页用户列表")
    @GetMapping("/getListByPage")
    public CommonResult<PageListVo> getListByPage(PageParamRequest pageParamRequest, String searchName,
                                                  String searchRealName, String searchPhone) {
        return CommonResult.success(loginService.getListByPage(pageParamRequest, searchName, searchRealName, searchPhone));
    }

}
